package com.itheima.homew;
/*【编号：707】
    请定义一个描述矩形（MyRectangle）的类，包含宽和高两个属性，
        提供获取矩形周长（perimeter）和面积（area）的方法。并编写测试类进行测试。*/
class MyRectangle{
    private double wide ;
    private double hight;

    public double getWide() {
        return wide;
    }

    public void setWide(double wide) {
        this.wide = wide;
    }

    public double getHight() {
        return hight;
    }

    public void setHight(double hight) {
        this.hight = hight;
    }

    public MyRectangle() {

    }

    public MyRectangle(double wide, double hight) {

        this.wide = wide;
        this.hight = hight;
    }
    public double perimeter(){
       double perimeter = (wide+hight)*2;
       return perimeter;
    } public double area(){
        double area = wide*hight;
        return area;
    }

}
public class Rectangle {
    public static void main(String[] args) {
        MyRectangle m1 = new MyRectangle(10.0,20.0);
        System.out.println(m1.area());
        System.out.println(m1.perimeter());
    }
}
